<?php
/**
 * #Celebrate Shieh
 *             ,%%%%%%%%,
 *           ,%%/\%%%%/\%%
 *          ,%%%\c "" J/%%%
 * %.       %%%%/ o  o \%%%
 * `%%.     %%%%    _  |%%%
 *  `%%     `%%%%(__Y__)%%'
 *  //       ;%%%%`\-/%%%'
 * ((       /  `%%%%%%%'
 *  \\    .'          |
 *   \\  /       \  | |
 *    \\/         ) | |
 *     \         /_ | |__
 *     (___________))))))) 攻城湿
 *
 *        _       _
 * __   _(_)_   _(_) __ _ _ __
 * \ \ / / \ \ / / |/ _` |'_ \
 *  \ V /| |\ V /| | (_| | | | |
 *   \_/ |_| \_/ |_|\__,_|_| |_|
 */

use Illuminate\Support\Facades\Route;

Route::group([ 'prefix' => 'system', 'namespace' => 'System', 'as' => 'system.' ], function () {
    Route::group([ 'prefix' => 'modify' ], function () {//个人设置
        Route::get('index', 'ModifyController@index')->name('modify.index');//个人设置展示
        Route::put('store', 'ModifyController@store')->name('modify.store');//个人设置保存
    });
    Route::group([ 'prefix' => 'config' ], function () {//系统配置
        Route::get('index', 'ConfigController@index')->name('config.index');//系统配置展示
        Route::put('store', 'ConfigController@store')->name('config.store');//系统配置保存
    });
    Route::resource('permission', 'PermissionController');//权限 资源路由
    Route::group([ 'prefix' => 'permission' ], function () {//权限
        Route::post('sort', 'PermissionController@sort_order')->name('permission.sort');//权限排序
    });
    Route::resource('user', 'UserController');//用户 资源路由
    Route::group([ 'prefix' => 'user' ], function () {//用户
        Route::post('status', 'UserController@status')->name('user.status');//用户修改状态
        Route::post('delete', 'UserController@delete')->name('user.delete');//用户删除
    });
    Route::resource('role', 'RoleController');//角色 资源路由
    Route::group([ 'prefix' => 'role' ], function () {//角色
        Route::post('delete', 'RoleController@delete')->name('role.delete');//角色 删除
    });
    Route::group([ 'prefix' => 'browse' ], function () {//浏览日志
        Route::get('index', 'BrowseController@index')->name('browse.index');//浏览日志
        Route::post('destroy', 'BrowseController@destroy')->name('browse.destroy');//删除日志
        Route::post('truncate', 'BrowseController@truncate')->name('browse.truncate');//清空日志
    });
    Route::group([ 'prefix' => 'log' ], function () {//操作日志
        Route::get('index', 'LogController@index')->name('log.index');//操作日志展示
        Route::get('edit', 'LogController@edit')->name('log.edit');//文件日志详情
    });
    Route::group([ 'prefix' => 'broken' ], function () {//上传文件碎片
        Route::get('index', 'BrokenController@index')->name('broken.index');//上传文件碎片管理展示
        Route::get('delete', 'BrokenController@delete')->name('broken.delete');//上传文件碎片删除
        Route::get('tree', 'BrokenController@tree')->name('broken.tree');//上传文件碎片树展示
    });
    Route::group([ 'prefix' => 'file' ], function () {//已上传文件
        Route::get('index', 'FileController@index')->name('file.index');//以上传文件管理展示
        Route::delete('/{file}', 'FileController@destroy')->name('file.destroy');//删除文件
        Route::post('delete', 'FileController@delete')->name('file.delete');//多个文件删除
        Route::get('reduction', 'FileController@reduction')->name('file.reduction');//从回收站还原文件
        Route::get('reductionAll', 'FileController@reductionAll')->name('file.reductionAll');//从回收站还原多个文件
    });
    Route::group([ 'prefix' => 'format' ], function () {//上传文件格式
        Route::get('index', 'FormatController@index')->name('format.index');//上传文件格式管理展示
        Route::put('/{format}', 'FormatController@update')->name('format.update');//上传文件格式修改
    });
});
